﻿<UserControl x:Class="EQual.MainModule.Documents.DocumentsDetailViews.DocumentVersionsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit" 
    xmlns:DocumentDetails="clr-namespace:EQual.MainModule"  >  

    <UserControl.Resources >
        <ObjectDataProvider x:Key="FormsProvider" ObjectType="{x:Type DocumentDetails:DocumentsProvider}" MethodName="GetFormsAndRecords" />

    </UserControl.Resources>
    
    <Grid>
        <dg:DataGrid Name="datagrid" AutoGenerateColumns="False" RowEditEnding="datagrid_RowEditEnding">
            <dg:DataGrid.Columns >
                <dg:DataGridComboBoxColumn SelectedValueBinding="{Binding FormId}"                                            
                                           SelectedValuePath="FormId"
                                           DisplayMemberPath="FormId"
                                           Header="Id"
                                           ItemsSource="{Binding Source={StaticResource FormsProvider}}">
                    <dg:DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="IsEditable" Value="True" />
                        </Style>
                    </dg:DataGridComboBoxColumn.EditingElementStyle>
                </dg:DataGridComboBoxColumn>

                <dg:DataGridComboBoxColumn SelectedValueBinding="{Binding FormId}"                                            
                                           SelectedValuePath="FormId"
                                           DisplayMemberPath="Title"
                                           Header="Title"
                                           ItemsSource="{Binding Source={StaticResource FormsProvider}}">
                    <dg:DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="IsEditable" Value="True" />
                        </Style>
                    </dg:DataGridComboBoxColumn.EditingElementStyle>
                </dg:DataGridComboBoxColumn>


            </dg:DataGrid.Columns>

        </dg:DataGrid>
    </Grid>
</UserControl>
